/*commented gen files are reminders of how variables were created*/

/*change path as necessary*/
use "C:Preaching to the Choir\Stata files\Dataverse files\Data2017survey.dta"

eststo clear

/* belief variables: Likert 1-5, lower number means agree more that waste causes problem
so variables are reverse coded:
gen ch_nature_r = ch_nature * -1
gen ch_litter_r = ch_litter * -1
gen ch_energy_r = ch_energy * -1
gen ch_landfills_r = ch_landfills * -1
gen nature_pre_r = nature_pre * -1
gen litter_pre_r = litter_pre * -1
gen energy_pre_r = energy_pre * -1
gen landfills_pre_r = landfills_pre * -1
*/

gsem (ch_nature_r <- video text, regress) (C<-nature_pre_r _cons), lclass(C 2) noconstant
eststo natureJESS,title("Nature")
gsem (ch_litter_r <- video text, regress) (C<-litter_pre_r _cons), lclass(C 2) noconstant
eststo litterJESS, title("Litter")
gsem (ch_energy_r <- video text, regress) (C<-energy_pre_r _cons), lclass(C 2) noconstant
eststo energyJESS, title("Energy")
gsem (ch_landfills_r <- video text, regress) (C<-landfills_pre_r _cons), lclass(C 2) noconstant
eststo landfillsJESS, title("Landfills")
esttab natureJESS litterJESS energyJESS landfillsJESS using TableOR21, b(2) not star nonum obslast compress label title("Table OR2_1: Latent Class Results for 2017 Survey Changes in Beliefs") addnotes("Notes: *,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "In structural equation results, higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this. In class membership results, higher coefficient values indicate the impact of more pro-environmental attitudes and beliefs on membership in Class 2.") mtitles rtf alignment(l) replace
/*some reformatting of table is necessary*/

/*attitudes, sense of responsibility, and personal norms
good: continuous scale 1-5, higher means reducing, reusing, recycling is more good
obligation: continuous scale 1-5, higher means stronger obligation to reduce/reuse/recycle
guilty: continuous scale 1-5, lower means stronger feeling of guilt if they don't reduce/reuse/recycle, so variables are reverse coded:
gen ch_guilty_r = ch_guilty * -1
gen guilty_pre_r = guilty_pre * -1
*/
gsem (ch_good <- video text, regress) (C<-good_pre _cons), lclass(C 2) noconstant
eststo goodJESS, title ("Reducing waste is good")
gsem (ch_obligation <- video text, regress) (C<-obligation_pre _cons), lclass(C 2) noconstant
eststo obligationJESS, title ("Strong obligation")
gsem (ch_guilty_r <- video text, regress) (C<-guilty_pre_r _cons), lclass(C 2) noconstant
eststo guiltyJESS, title("guilt")

esttab goodJESS obligationJESS guiltyJESS using TableOR22,b(2) not star nonum obslast compress label title("Table OR2_2: Latent Class Results for 2017 Survey Changes in Attitudes, Sense of Responsibility, and Personal Norms") addnotes("Notes: *,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "In structural equation results, higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this. In class membership results, higher coefficient values indicate the impact of more pro-environmental attitudes and beliefs on membership in Class 2.") mtitles rtf alignment(l) replace
/*some reformatting of table is necessary*/

/*intended variables: Likert 1-5, higher number means more likely to reduce/reuse/recycle
*/
gsem (ch_intended <- video text, regress) (C<-intended_pre _cons), lclass(C 2) noconstant
eststo intendedJESS, title("intend")
esttab intendedJESS using TableOR23,b(2) not star nonum obslast compress label title("Table OR2_3: Latent Class Results for 2017 Survey Changes in Intended Behavior") addnotes("Notes: *,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "In structural equation results, higher coefficient values indicate more pro-environmental attitudes and beliefs. In class membership results, higher coefficient values indicate the impact of more pro-environmental attitudes and beliefs on membership in Class 2.") mtitles rtf alignment(l) replace
/*some reformatting of table is necessary*/

/*change path as necessary*/
use "C:Preaching to the Choir\Stata files\Dataverse files\Data201516surveys.dta"

eststo clear

/*q31_repeat and q31 are reverse coded:
gen q31r_repeat = q31_repeat * (-1) 
q31r = q31* -1
*/

gsem (chq31r <- sawtext sawart sawphototext sawartonly,regress) (C<- q31r _cons), lclass(C 2) noconstant
eststo q31rLC, title("Individual actions matter")
gsem (chq33 <- sawtext sawart sawphototext sawartonly,regress) (C<- q33 _cons), lclass(C 2) noconstant
eststo q33LC, title("Personal responsibility")
esttab q31rLC q33LC using TableOR24, b(2) not star nonum obslast compress label title("Table OR2_4: Latent Class Results for 2015-16 Surveys Changes in General Attitude and Beliefs") addnotes(Notes:"*,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "In structural equation results, higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this." "In class membership results, higher coefficient values indicate the impact of more pro-environmental attitudes and beliefs on membership in Class 2.") mtitles rtf alignment(l) replace
/*some reformatting of table is necessary*/

gsem (chq57_1 <- sawtext sawart sawphototext sawartonly,regress) (C<- q57_1 _cons), lclass(C 2) noconstant
eststo q571LC, title("Litter")
gsem (chq57_2 <- sawtext sawart sawphototext sawartonly,regress) (C<- q57_2 _cons), lclass(C 2) noconstant
eststo q572LC, title("Landfill pollution")
gsem (chq57_3 <- sawtext sawart sawphototext sawartonly,regress) (C<- q57_3 _cons), lclass(C 2) noconstant
eststo q573LC, title("Ocean pollution")
esttab q571LC q572LC q573LC using TableOR25, b(2) not star nonum obslast compress label title("Table OR2_5: Latent Class Results for 2015-16 Surveys Changes in Beliefs about Plastic Pollution") addnotes("Notes: *,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "In structural equation results, higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this." "In class membership results, higher coefficient values indicate the impact of more pro-environmental attitudes and beliefs on membership in Class 2.") mtitles rtf alignment(l) replace
/*some reformatting of table is necessary*/

/*change path as necessary*/
use "C:Preaching to the Choir\Stata files\Dataverse files\Data2020survey.dta"

eststo clear

/*reminder of reverse coded q31
gen q31r = q31 * -1*/

gsem (chq57_1 <- sawtext sawart sawphototext,regress) (C<- q57_1 _cons ), lclass(C 2) noconstant
eststo q571LC, title("litter")

gsem (chq57_2 <- sawtext sawart sawphototext,regress) (C<- q57_2 _cons), lclass(C 2) noconstant
eststo q572LC, title("landfill")

gsem (chq57_3 <- sawtext sawart sawphototext,regress) (C<- q57_3 _cons), lclass(C 2) noconstant
eststo q573LC, title("ocean")

gsem (chq31r <- sawtext sawart sawphototext,regress) (C<- q31r _cons), lclass(C 2) noconstant
eststo q31rLC, title("individual actions")

gsem (chq33 <- sawtext sawart sawphototext,regress) (C<- q33 _cons), lclass(C 2) noconstant
eststo q33LC, title("responsibility")

esttab q31rLC q33LC using TableOR26, b(2) not star nonum compress label title("Table OR2_6: Latent Class Results for 2020 Survey Changes in General Attitude and Beliefs") addnotes(Notes:"*,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "In structural equation results, higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this." "In class membership results, higher coefficient values indicate the impact of more pro-environmental attitudes and beliefs on membership in Class 2.") mtitles rtf alignment(l) replace
/*some reformatting of table is necessary*/

esttab q571LC q572LC q573LC using TableOR27, b(2) not star nonum obslast compress label title("Table OR2_7: Latent Class Results for 2020 Survey Changes in Beliefs about Plastic Pollution") addnotes("Notes: *,**,***: statistically different than zero at .05, .01, and .001 levels, respectively." "In structural equation results, higher coefficient values indicate more pro-environmental attitudes and beliefs; when necessary, variables are reverse coded to accomplish this." "In class membership results, higher coefficient values indicate the impact of more pro-environmental attitudes and beliefs on membership in Class 2.") mtitles rtf alignment(l) replace
/*some reformatting of table is necessary*/